//负责封装所有与组织架构相关的接口
import instance from "@/utils/request.js";
//获取组织架构列表
export function getDepartmentApi() {
  return instance({
    url: '/company/department'
  })

}

//封装删除组织架构的接口
export function delDepartmentapi(id) {
  return instance({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}

//封装新增组织架构的接口
export function addDepartmentApi(data) {
  return instance({
    url: '/company/department',
    method: 'POST',
    data
  })
}

//根据 id 得到部门信息
export function getDepartmentByIdApi(id) {
  return instance({
    url: `/company/department/${id}`
  })
}
//根据 id 修改部门信息
export function editDepartmentByIdApi(data) {
  return instance({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
